<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// [ 应用入口文件 ]
namespace think;
header("Access-Control-Allow-Origin:*");
header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE");
header('Access-Control-Allow-Headers: Authori-zation,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With,adcode,token,os, over, version, devsn, registrationid');
header('Access-Control-Max-Age: 1728000');
// [ 应用入口文件 ]
if (!empty($_SERVER['REQUEST_METHOD'])) {
    if ($_SERVER['REQUEST_METHOD'] == 'options' || $_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
        echo json_encode(['data' => [], 'code' => 200, 'msg' => 'option请求成功！']);
        exit;
    }
}
// 定义框架目录
define('THINKPHP_PATH', __DIR__.'/../');

// 加载基础文件
require  THINKPHP_PATH . 'thinkphp/base.php';
// 加载vendor自动加载文件
require  THINKPHP_PATH . 'vendor/autoload.php';
// 支持事先使用静态方法设置Request对象和Config对象

// 执行应用并响应
Container::get('app')->run()->send();


